package com.szh.service;

import java.security.GeneralSecurityException;
import java.util.Map;

public interface WxPayService {
    /**
     * 调用统一下单API，生成微信支付二维码
     * @param productId 商品id
     * @return 返回支付二维码链接和订单号
     * @throws Exception Exception
     */
    Map<String, Object> nativePay(Long productId) throws Exception;

    /**
     * 处理订单
     * @param bodyMap bodyMap
     * @throws GeneralSecurityException GeneralSecurityException
     */
    void processOrder(Map<String, Object> bodyMap) throws GeneralSecurityException;

    /**
     * 取消订单
     * @param orderNo 订单号
     * @throws Exception Exception
     */
    void cancelOrder(String orderNo) throws Exception;

    /**
     * 查询订单
     * @param orderNo 订单号
     * @return String
     * @throws Exception Exception
     */
    String queryOrder(String orderNo) throws Exception;

    void checkOrderStatus(String orderNo) throws Exception;

    /**
     * 申请退款
     * @param orderNo 订单号
     * @param reason 退款原因
     * @throws Exception Exception
     */
    void refund(String orderNo, String reason) throws Exception;

    /**
     * 查询单笔退款
     * @param refundNo 退款单号
     * @return String
     * @throws Exception Exception
     */
    String queryRefund(String refundNo) throws Exception;

    void checkRefundStatus(String refundNo) throws Exception;

    /**
     * 处理退款单
     * @param bodyMap bodyMap
     * @throws Exception Exception
     */
    void processRefund(Map<String, Object> bodyMap) throws Exception;

    /**
     * 申请账单，获取账单url
     * @param billDate 账单日期
     * @param type 账单类型
     * @return String
     * @throws Exception Exception
     */
    String queryBill(String billDate, String type) throws Exception;

    /**
     * 下载账单
     * @param billDate 账单日期
     * @param type 账单类型
     * @return String
     * @throws Exception Exception
     */
    String downloadBill(String billDate, String type) throws Exception;
}
